//
//  AccountInformationTableViewCell.m
//  ZYZB
//
//  Created by ENERGY on 2018/7/9.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "AccountInformationTableViewCell.h"

#define iconBtnW 32/WIDTH_6_SCALE
@interface AccountInformationTableViewCell()
@property (nonatomic, strong)UILabel * titleLab;
@end
@implementation AccountInformationTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        __weak typeof (self)weakSelf = self;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.contentLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.top.equalTo(weakSelf.contentView.mas_top);
            make.bottom.equalTo(weakSelf.contentView.mas_bottom).mas_offset(-1/WIDTH_6_SCALE);
        }];
        [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.titleLab.mas_centerY);
        }];
        UIView * lineView = [[UIView alloc] init];
        lineView.backgroundColor = getColor(grayColor);
        [self.contentView addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(weakSelf.contentView);
            make.left.equalTo(weakSelf.titleLab.mas_left);
            make.height.mas_offset(1/WIDTH_6_SCALE);
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
        }];
        self.lineView = lineView;
    }return self;
}

- (UILabel *)titleLab{
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = DEF_FontSize_12;
        _titleLab.textColor = [UIColor blackColor];
        _titleLab.textAlignment = NSTextAlignmentLeft;
        _titleLab.text = @"用户名";
    }return _titleLab;
}
- (UILabel *)contentLab{
    if (!_contentLab) {
        _contentLab = [[UILabel alloc] init];
        _contentLab.font = DEF_FontSize_12;
        _contentLab.textColor = [UIColor blackColor];
        _contentLab.textAlignment = NSTextAlignmentRight;
        _contentLab.text = @"1234567890";
    }return _contentLab;
}
- (void)setTitleModel:(NSDictionary *)titleModel{
    _titleModel = titleModel;
    self.titleLab.text = titleModel[@"title"];
}
//- (void)setContentModel:(NSDictionary *)contentModel{
//    _contentModel = contentModel;
//    self.contentLab.text = contentModel[@"content"];
//}
@end
